package key 
{
	import flash.display.Sprite;
	import iscript.gameFramework.GameLite.events.KeyInputEvent;
	import iscript.gameFramework.GameLite.Game;
	import iscript.gameFramework.GameLite.input.KeyInputData;
	/**
	 * ...
	 * @author 
	 */
	public class KeyManager extends Sprite
	{
		
		public function KeyManager() 
		{
			 var game:Game = new Game(stage);
		 
	 /*		 var a:Array = [65, 65, 65, 65, 65, 83, 68, 74, 75]
			 
			 var  keydata:Vector.<KeyInputData> = new Vector.<KeyInputData>();
			 
			 //	 var keyinputdata:KeyInputData = new KeyInputData();
			 var  preveKeyCode:int;
			 var  currentKeyCode:int;
			 
			 for each (var valueKeyCode:int in a) {
				  var keyinputdata:KeyInputData = new KeyInputData();
				     if (currentKeyCode == 0) {						
						     currentKeyCode = valueKeyCode;
							 keyinputdata.keyCode = currentKeyCode;
							 keyinputdata.keepDownCount  = 1;
							 keydata.push(keyinputdata);
						 }
					 if (currentKeyCode != 0) {
							preveKeyCode = currentKeyCode;
							currentKeyCode = valueKeyCode;
							if (preveKeyCode == currentKeyCode) {
								  keydata[keydata.length - 1].keepDownCount ++;
								}else {
								   keyinputdata.keyCode = currentKeyCode;
								   keyinputdata.keepDownCount  = 1;
								   keydata.push(keyinputdata);
								}
					}
			  }*/ 
			 
			 Game.keyInput.addEventListener(KeyInputEvent.RELEASEKEYGROUP,keyGroupLogic)
			 
		}
		
		private function keyGroupLogic(e:KeyInputEvent):void 
		{
			
			if (e.keyGroupData.length > 1) {
				trace(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>")
			   for each( var node:KeyInputData in e.keyGroupData) {
				   trace(node.keyCode,node.keepDownCount)
				   }
				//trace(e.keyGroupData);
			}
		}
		
	}

}